<template>
  <div class="divBox" style="padding:10px 0">
    <el-card class="box-card" shadow="never">
      <div slot="header" class="clearfix" style="margin-top:10px">
      </div>
      <el-table
        v-loading="listLoading"
        :data="list"
        size="mini"
        style="width: 100%"
      >
        <el-table-column
          align="center"
          label="ID"
          min-width="50"
          prop="id"
        />
        <el-table-column
          align="center"
          label="名称"
          min-width="50"
          prop="nick"
        >
        </el-table-column>
        <el-table-column
          align="center"
          label="内容"
          min-width="50"
          prop="message"
        />
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { liveMessageList } from '@/api/marketing.js'
import GoodList from '@/components/goodList'

export default {
  name: 'invite',
  components: { GoodList },
  props: {
    liveId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      listLoading: false,
      list: [],
    }
  },
  watch: {
    liveId(val) {
      if (val) {
        this.getlist()
      }
    }
  },
  created() {
    this.getlist()
  },
  methods: {
    getlist() {
      this.listLoading = true
      let parmas = {
        liveId: this.liveId
      }
      liveMessageList(parmas).then((res) => {
        this.listLoading = false
        this.list = res.results
      }).catch((res) => {
        this.listLoading = false
      })
    },
  }
}
</script>

<style lang="scss" scoped>
.divBox {
  .el-switch__label--right {
    position: absolute;
    right: 10px;
  }

  .el-switch__label--left {
    position: absolute;
    left: 10px;
  }

  .video-box {
    width: 500px;
    height: 500px;
    margin: 0 auto;

    video {
      margin: 0 auto;
    }
  }
}
</style>
